import { ApiProperty } from '@nestjs/swagger';
import { AutoIncrementID } from '@typegoose/auto-increment';
import { Index, plugin, Prop } from '@typegoose/typegoose';

@Index({ name: 1 }, { unique: true })
@plugin(AutoIncrementID, { field: 'nid', startAt: 1 })
export class BaseSchemas {
  @Prop()
  readonly nid: number;

  @Prop()
  @ApiProperty({ description: '名称', type: String })
  name: string;
}
